package com.atguigu.springcloud.ResponseBody;

import org.springframework.beans.factory.annotation.Autowired;

public class Case {


//    成功
    public <T> Body success(T data){
        Body<Object> body = new Body<>();
        body.setCode(200);
        body.setMessage("操作成功！");
        body.setDate(data);
        return body;
    }

//    失败
    public Body fail(){
        Body<Object> objectBody = new Body<>();
        objectBody.setCode(500);
        objectBody.setMessage("操作失败！");
        objectBody.setDate(null);
        return objectBody;
    }
}
